package com.ms.game.utils.actionblocker;

public enum ActionBlockType {
	
	/**
	 * 取停權名單 </br>
	 * 500毫秒 做一次</br>
	 */
	GET_TERMINATED_ACCOUNT_LIST(500, 1)
	;
	
	/**
	 * 
	 * @param interval
	 */
	ActionBlockType(long interval, int maxTry){
		this.interval = interval;
		this.maxTry = maxTry;
	}
	
	/**
	 * 間隔時間 (毫秒)
	 */
	private long interval;
	
	private int maxTry;

	public long getInterval() {
		return interval;
	}

	public void setInterval(long interval) {
		this.interval = interval;
	}
	
	public int getMaxTry() {
		return maxTry;
	}

	public void setMaxTry(int maxTry) {
		this.maxTry = maxTry;
	}

	/**
	 * 取得阻擋用的key
	 * @param primaryKey ( e.g. guid or accountId)
	 * @return
	 */
	public String getBlockKey(String primaryKey) {
		return " ActionBlock:" + this.name() + ":" + primaryKey;
	}
}
